﻿USE [EventScavenger]
GO
/****** Object:  Table [dbo].[EventSources]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EventSources](
	[SourceID] [int] IDENTITY(1,1) NOT NULL,
	[Source] [varchar](255) NOT NULL,
 CONSTRAINT [PK_EventSources] PRIMARY KEY CLUSTERED 
(
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[EventLogHistory]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EventLogHistory](
	[HistoryID] [int] IDENTITY(1,1) NOT NULL,
	[MachineLogID] [int] NOT NULL,
	[EventID] [int] NOT NULL,
	[Year] [int] NOT NULL,
	[Month] [smallint] NOT NULL,
	[Day] [smallint] NOT NULL,
	[Hour] [smallint] NOT NULL,
	[SourceID] [int] NOT NULL,
	[EventTypeName] [char](1) NOT NULL,
	[Records] [int] NOT NULL,
	[Date]  AS (CONVERT([datetime],((((((CONVERT([char](4),[year],(0))+'-')+CONVERT([char](2),[Month],(0)))+'-')+CONVERT([char](2),[Day],(0)))+' ')+CONVERT([char](2),[Hour],(0)))+':00',(0))),
 CONSTRAINT [PK_EventLogHistory] PRIMARY KEY CLUSTERED 
(
	[HistoryID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON, DATA_COMPRESSION = PAGE) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_EventLogHistory] ON [dbo].[EventLogHistory] 
(
	[MachineLogID] ASC,
	[EventID] ASC,
	[Year] ASC,
	[Month] ASC,
	[Day] ASC,
	[Hour] ASC,
	[SourceID] ASC,
	[EventTypeName] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_EventLogHistory_YearMonthDay] ON [dbo].[EventLogHistory] 
(
	[Year] ASC,
	[Month] ASC,
	[Day] ASC
)
INCLUDE ( [HistoryID]) WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[UserNames]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[UserNames](
	[UserNameID] [int] IDENTITY(1,1) NOT NULL,
	[UserName] [varchar](50) NULL,
 CONSTRAINT [PK_UserNames] PRIMARY KEY CLUSTERED 
(
	[UserNameID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_UserNames] ON [dbo].[UserNames] 
(
	[UserName] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Settings]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Settings](
	[SettingName] [varchar](50) NOT NULL,
	[SettingValue] [varchar](50) NOT NULL,
 CONSTRAINT [PK_Settings] PRIMARY KEY CLUSTERED 
(
	[SettingName] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
/****** Object:  Table [dbo].[EventIDs]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[EventIDs](
	[EventID] [int] NOT NULL,
 CONSTRAINT [PK_EventIDs] PRIMARY KEY CLUSTERED 
(
	[EventID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[EventCategories]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EventCategories](
	[CategoryID] [int] IDENTITY(1,1) NOT NULL,
	[Category] [varchar](50) NULL,
 CONSTRAINT [PK_EventCategories] PRIMARY KEY CLUSTERED 
(
	[CategoryID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_EventCategories] ON [dbo].[EventCategories] 
(
	[Category] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[Collectors]    Script Date: 07/06/2010 14:03:46 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[Collectors](
	[CollectorID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [varchar](100) NOT NULL,
	[ThreadRecycleFrequencyMinutes] [int] NOT NULL,
	[NextRecycleTime] [datetime] NULL,
	[ThreadRecyclingEnabled] [bit] NOT NULL,
	[ImportsEnabled] [bit] NOT NULL,
	[ImportFrequencyMinutes] [int] NOT NULL,
 CONSTRAINT [PK_Collectors] PRIMARY KEY CLUSTERED 
(
	[CollectorID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_Collectors_Name] ON [dbo].[Collectors] 
(
	[Name] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[PollFilters]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PollFilters](
	[PollFilterID] [int] IDENTITY(1,1) NOT NULL,
	[Name] [nvarchar](100) NOT NULL,
	[MessageContains] [nvarchar](1024) NULL,
	[LastChanged] [datetime] NOT NULL,
	[ExcludeInfo] [bit] NOT NULL,
	[ExcludeWarn] [bit] NOT NULL,
	[ExcludeErr] [bit] NOT NULL,
	[ExcludeSucAud] [bit] NOT NULL,
	[ExcludeFailAud] [bit] NOT NULL,
 CONSTRAINT [PK_PollFilters] PRIMARY KEY CLUSTERED 
(
	[PollFilterID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[PollFilterEventIDs]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PollFilterEventIDs](
	[PollFilterID] [int] NOT NULL,
	[EventID] [int] NOT NULL,
	[Exclude] [bit] NOT NULL,
 CONSTRAINT [PK_PollFilterEventIDs] PRIMARY KEY CLUSTERED 
(
	[PollFilterID] ASC,
	[EventID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[MachineLogs]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[MachineLogs](
	[MachineLogID] [int] IDENTITY(1,1) NOT NULL,
	[CollectorID] [int] NOT NULL,
	[Machine] [varchar](255) NOT NULL,
	[LogName] [varchar](255) NOT NULL,
	[LastPollTime] [datetime] NULL,
	[Enabled] [bit] NOT NULL,
	[PollFrequency] [int] NOT NULL,
	[MaxEntryCount] [int] NOT NULL,
	[PollFilterID] [int] NULL,
 CONSTRAINT [PK_MachineLogs] PRIMARY KEY CLUSTERED 
(
	[MachineLogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE UNIQUE NONCLUSTERED INDEX [IX_MachineLogUnique] ON [dbo].[MachineLogs] 
(
	[Machine] ASC,
	[LogName] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[PollFilterSources]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[PollFilterSources](
	[PollFilterID] [int] NOT NULL,
	[SourceID] [int] NOT NULL,
	[Exclude] [bit] NOT NULL,
 CONSTRAINT [PK_PollFilterSources] PRIMARY KEY CLUSTERED 
(
	[PollFilterID] ASC,
	[SourceID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[EventLogEntries]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
SET ANSI_PADDING ON
GO
CREATE TABLE [dbo].[EventLogEntries](
	[EntryID] [bigint] IDENTITY(1,1) NOT NULL,
	[TimeGenerated] [datetime] NOT NULL,
	[MachineLogID] [int] NOT NULL,
	[RecordNumber] [int] NOT NULL,
	[EventID] [int] NOT NULL,
	[SourceID] [int] NOT NULL,
	[EventTypeName] [char](1) NOT NULL,
	[Message] [nvarchar](4000) NULL,
	[CategoryID] [int] NULL,
	[UserNameID] [int] NULL,
	[Repeat] [int] NOT NULL,
	[Archived] [bit] NOT NULL,
 CONSTRAINT [PK_EventLogEntries] PRIMARY KEY CLUSTERED 
(
	[TimeGenerated] ASC,
	[MachineLogID] ASC,
	[RecordNumber] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
SET ANSI_PADDING OFF
GO
CREATE NONCLUSTERED INDEX [IX_EventLogEntries_EventID] ON [dbo].[EventLogEntries] 
(
	[EntryID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
CREATE NONCLUSTERED INDEX [IX_EventLogEntries_MachineLogID] ON [dbo].[EventLogEntries] 
(
	[MachineLogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, SORT_IN_TEMPDB = OFF, IGNORE_DUP_KEY = OFF, DROP_EXISTING = OFF, ONLINE = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
GO
/****** Object:  Table [dbo].[ImportLogs]    Script Date: 07/06/2010 14:03:47 ******/
SET ANSI_NULLS ON
GO
SET QUOTED_IDENTIFIER ON
GO
CREATE TABLE [dbo].[ImportLogs](
	[ForeignLogID] [int] IDENTITY(1,1) NOT NULL,
	[CollectorID] [int] NOT NULL,
	[Server] [nvarchar](255) NOT NULL,
	[Database] [nvarchar](255) NOT NULL,
	[MachineLogID] [int] NOT NULL,
	[Enabled] [bit] NOT NULL,
 CONSTRAINT [PK_ImportLogs] PRIMARY KEY CLUSTERED 
(
	[ForeignLogID] ASC
)WITH (PAD_INDEX  = OFF, STATISTICS_NORECOMPUTE  = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS  = ON, ALLOW_PAGE_LOCKS  = ON) ON [PRIMARY]
) ON [PRIMARY]
GO
/****** Object:  Default [DF_Collectors_ThreadRecycleFrequencyMinutes]    Script Date: 07/06/2010 14:03:46 ******/
ALTER TABLE [dbo].[Collectors] ADD  CONSTRAINT [DF_Collectors_ThreadRecycleFrequencyMinutes]  DEFAULT ((1440)) FOR [ThreadRecycleFrequencyMinutes]
GO
/****** Object:  Default [DF_Collectors_ThreadRecyclingEnabled]    Script Date: 07/06/2010 14:03:46 ******/
ALTER TABLE [dbo].[Collectors] ADD  CONSTRAINT [DF_Collectors_ThreadRecyclingEnabled]  DEFAULT ((1)) FOR [ThreadRecyclingEnabled]
GO
/****** Object:  Default [DF_Collectors_ImportsEnabled]    Script Date: 07/06/2010 14:03:46 ******/
ALTER TABLE [dbo].[Collectors] ADD  CONSTRAINT [DF_Collectors_ImportsEnabled]  DEFAULT ((0)) FOR [ImportsEnabled]
GO
/****** Object:  Default [DF_Collectors_ImportFrequencyMinutes]    Script Date: 07/06/2010 14:03:46 ******/
ALTER TABLE [dbo].[Collectors] ADD  CONSTRAINT [DF_Collectors_ImportFrequencyMinutes]  DEFAULT ((15)) FOR [ImportFrequencyMinutes]
GO
/****** Object:  Default [DF_EventLogEntries_Repeat]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[EventLogEntries] ADD  CONSTRAINT [DF_EventLogEntries_Repeat]  DEFAULT ((1)) FOR [Repeat]
GO
/****** Object:  Default [DF_EventLogEntries_Archived]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[EventLogEntries] ADD  CONSTRAINT [DF_EventLogEntries_Archived]  DEFAULT ((0)) FOR [Archived]
GO
/****** Object:  Default [DF_ImportLogs_Enabled]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[ImportLogs] ADD  CONSTRAINT [DF_ImportLogs_Enabled]  DEFAULT ((1)) FOR [Enabled]
GO
/****** Object:  Default [DF_MachineLogs_MaxEntryCount]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[MachineLogs] ADD  CONSTRAINT [DF_MachineLogs_MaxEntryCount]  DEFAULT ((300000)) FOR [MaxEntryCount]
GO
/****** Object:  Default [DF_PollFilterEventIDs_Exclude]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilterEventIDs] ADD  CONSTRAINT [DF_PollFilterEventIDs_Exclude]  DEFAULT ((0)) FOR [Exclude]
GO
/****** Object:  Default [DF_PollFilters_LastChanged]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilters] ADD  CONSTRAINT [DF_PollFilters_LastChanged]  DEFAULT (getdate()) FOR [LastChanged]
GO
/****** Object:  Default [DF_PollFilters_ExcludeInfo]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilters] ADD  CONSTRAINT [DF_PollFilters_ExcludeInfo]  DEFAULT ((0)) FOR [ExcludeInfo]
GO
/****** Object:  Default [DF_PollFilters_ExcludeWarn]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilters] ADD  CONSTRAINT [DF_PollFilters_ExcludeWarn]  DEFAULT ((0)) FOR [ExcludeWarn]
GO
/****** Object:  Default [DF_PollFilters_ExcludeErr]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilters] ADD  CONSTRAINT [DF_PollFilters_ExcludeErr]  DEFAULT ((0)) FOR [ExcludeErr]
GO
/****** Object:  Default [DF_PollFilters_ExcludeSucAud]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilters] ADD  CONSTRAINT [DF_PollFilters_ExcludeSucAud]  DEFAULT ((0)) FOR [ExcludeSucAud]
GO
/****** Object:  Default [DF_PollFilters_ExcludeFailAud]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilters] ADD  CONSTRAINT [DF_PollFilters_ExcludeFailAud]  DEFAULT ((0)) FOR [ExcludeFailAud]
GO
/****** Object:  Default [DF_PollFilterSources_Exclude]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilterSources] ADD  CONSTRAINT [DF_PollFilterSources_Exclude]  DEFAULT ((0)) FOR [Exclude]
GO
/****** Object:  ForeignKey [FK_EventLogEntries_EventCategories]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[EventLogEntries]  WITH CHECK ADD  CONSTRAINT [FK_EventLogEntries_EventCategories] FOREIGN KEY([CategoryID])
REFERENCES [dbo].[EventCategories] ([CategoryID])
GO
ALTER TABLE [dbo].[EventLogEntries] CHECK CONSTRAINT [FK_EventLogEntries_EventCategories]
GO
/****** Object:  ForeignKey [FK_EventLogEntries_EventIDs]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[EventLogEntries]  WITH CHECK ADD  CONSTRAINT [FK_EventLogEntries_EventIDs] FOREIGN KEY([EventID])
REFERENCES [dbo].[EventIDs] ([EventID])
GO
ALTER TABLE [dbo].[EventLogEntries] CHECK CONSTRAINT [FK_EventLogEntries_EventIDs]
GO
/****** Object:  ForeignKey [FK_EventLogEntries_EventSources]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[EventLogEntries]  WITH CHECK ADD  CONSTRAINT [FK_EventLogEntries_EventSources] FOREIGN KEY([SourceID])
REFERENCES [dbo].[EventSources] ([SourceID])
GO
ALTER TABLE [dbo].[EventLogEntries] CHECK CONSTRAINT [FK_EventLogEntries_EventSources]
GO
/****** Object:  ForeignKey [FK_EventLogEntries_MachineLogs]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[EventLogEntries]  WITH CHECK ADD  CONSTRAINT [FK_EventLogEntries_MachineLogs] FOREIGN KEY([MachineLogID])
REFERENCES [dbo].[MachineLogs] ([MachineLogID])
GO
ALTER TABLE [dbo].[EventLogEntries] CHECK CONSTRAINT [FK_EventLogEntries_MachineLogs]
GO
/****** Object:  ForeignKey [FK_EventLogEntries_UserNames]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[EventLogEntries]  WITH CHECK ADD  CONSTRAINT [FK_EventLogEntries_UserNames] FOREIGN KEY([UserNameID])
REFERENCES [dbo].[UserNames] ([UserNameID])
GO
ALTER TABLE [dbo].[EventLogEntries] CHECK CONSTRAINT [FK_EventLogEntries_UserNames]
GO
/****** Object:  ForeignKey [FK_ImportLogs_Collectors]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[ImportLogs]  WITH CHECK ADD  CONSTRAINT [FK_ImportLogs_Collectors] FOREIGN KEY([CollectorID])
REFERENCES [dbo].[Collectors] ([CollectorID])
GO
ALTER TABLE [dbo].[ImportLogs] CHECK CONSTRAINT [FK_ImportLogs_Collectors]
GO
/****** Object:  ForeignKey [FK_ImportLogs_MachineLogs]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[ImportLogs]  WITH CHECK ADD  CONSTRAINT [FK_ImportLogs_MachineLogs] FOREIGN KEY([MachineLogID])
REFERENCES [dbo].[MachineLogs] ([MachineLogID])
GO
ALTER TABLE [dbo].[ImportLogs] CHECK CONSTRAINT [FK_ImportLogs_MachineLogs]
GO
/****** Object:  ForeignKey [FK_MachineLogs_Collectors]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[MachineLogs]  WITH CHECK ADD  CONSTRAINT [FK_MachineLogs_Collectors] FOREIGN KEY([CollectorID])
REFERENCES [dbo].[Collectors] ([CollectorID])
GO
ALTER TABLE [dbo].[MachineLogs] CHECK CONSTRAINT [FK_MachineLogs_Collectors]
GO
/****** Object:  ForeignKey [FK_MachineLogs_PollFilters]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[MachineLogs]  WITH CHECK ADD  CONSTRAINT [FK_MachineLogs_PollFilters] FOREIGN KEY([PollFilterID])
REFERENCES [dbo].[PollFilters] ([PollFilterID])
GO
ALTER TABLE [dbo].[MachineLogs] CHECK CONSTRAINT [FK_MachineLogs_PollFilters]
GO
/****** Object:  ForeignKey [FK_PollFilterEventIDs_EventIDs]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilterEventIDs]  WITH CHECK ADD  CONSTRAINT [FK_PollFilterEventIDs_EventIDs] FOREIGN KEY([EventID])
REFERENCES [dbo].[EventIDs] ([EventID])
GO
ALTER TABLE [dbo].[PollFilterEventIDs] CHECK CONSTRAINT [FK_PollFilterEventIDs_EventIDs]
GO
/****** Object:  ForeignKey [FK_PollFilterEventIDs_PollFilters]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilterEventIDs]  WITH CHECK ADD  CONSTRAINT [FK_PollFilterEventIDs_PollFilters] FOREIGN KEY([PollFilterID])
REFERENCES [dbo].[PollFilters] ([PollFilterID])
GO
ALTER TABLE [dbo].[PollFilterEventIDs] CHECK CONSTRAINT [FK_PollFilterEventIDs_PollFilters]
GO
/****** Object:  ForeignKey [FK_PollFilterSources_EventSources]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilterSources]  WITH CHECK ADD  CONSTRAINT [FK_PollFilterSources_EventSources] FOREIGN KEY([SourceID])
REFERENCES [dbo].[EventSources] ([SourceID])
GO
ALTER TABLE [dbo].[PollFilterSources] CHECK CONSTRAINT [FK_PollFilterSources_EventSources]
GO
/****** Object:  ForeignKey [FK_PollFilterSources_PollFilters]    Script Date: 07/06/2010 14:03:47 ******/
ALTER TABLE [dbo].[PollFilterSources]  WITH CHECK ADD  CONSTRAINT [FK_PollFilterSources_PollFilters] FOREIGN KEY([PollFilterID])
REFERENCES [dbo].[PollFilters] ([PollFilterID])
GO
ALTER TABLE [dbo].[PollFilterSources] CHECK CONSTRAINT [FK_PollFilterSources_PollFilters]
GO
